🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / firmware / src / commonMain / kotlin / org / meshtastic / feature / firmware / FirmwareUpdateManager.kt
Displaying Raw • Download
feature/firmware/src/commonMain/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateManager.kt 2d20cd8a4708e2ef66e98d5259f3a97ec93f240a (2d20cd8a) Text, 2.67 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.firmware
Tff7b72import T7ee787org.meshtastic.core.common.util.CommonUri
Tff7b72import T7ee787org.meshtastic.core.database.entity.FirmwareRelease
Tff7b72import T7ee787org.meshtastic.core.model.DeviceHardware
T8b949e/**
* Routes firmware update requests to the appropriate platform-specific handler based on the active connection type
* (BLE, WiFi/TCP, or USB) and device architecture.
*/
Tff7b72interface T56d364FirmwareUpdateManager Tb4b4b4{
T8b949e/**
* Begin a firmware update for the connected device.
*
* @param release The firmware release to install.
* @param hardware The target device's hardware descriptor.
* @param address The bare device address (MAC, IP, or serial path) with the transport prefix stripped.
* @param updateState Callback invoked as the update progresses through [FirmwareUpdateState] stages.
* @param firmwareUri Optional pre-selected firmware file URI (for "update from file" flows).
* @return A [FirmwareArtifact] that should be cleaned up by the caller, or `null` if the update was not started.
*/
Tff7b72suspend Tff7b72fun Td2a8ffstartUpdateTb4b4b4(
Te6edf3releaseTb4b4b4: Te6edf3FirmwareReleaseTb4b4b4,
Te6edf3hardwareTb4b4b4: Te6edf3DeviceHardwareTb4b4b4,
Te6edf3addressTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3updateStateTb4b4b4: Tb4b4b4(Te6edf3FirmwareUpdateStateTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3firmwareUriTb4b4b4: Te6edf3CommonUri? Tff7b72= Tff7b72nullTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3FirmwareArtifact?
T8b949e/**
* Recover a device stranded in nRF DFU/bootloader mode after an interrupted update, while the app is disconnected.
*
* Unlike [startUpdate], routing does not depend on the (absent) live connection — this always drives the BLE DFU
* handler, which derives the `MAC+1` bootloader address from [address] and tolerates a device that is already in
* DFU mode.
*
* @param address The device's normal mesh BLE address (transport prefix stripped).
*/
Tff7b72suspend Tff7b72fun Td2a8ffrecoverDfuDeviceTb4b4b4(
Te6edf3releaseTb4b4b4: Te6edf3FirmwareReleaseTb4b4b4,
Te6edf3hardwareTb4b4b4: Te6edf3DeviceHardwareTb4b4b4,
Te6edf3addressTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3updateStateTb4b4b4: Tb4b4b4(Te6edf3FirmwareUpdateStateTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3FirmwareArtifact?
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s